package com.eascs.workflow.common.service.wf;

import java.util.List;

import com.eascs.app.dao.PageResult;
import com.eascs.workflow.common.entity.wf.DicData;
import com.eascs.workflow.common.entity.wf.ProcessTaskMain;
import com.eascs.workflow.common.entity.wf.ProcessTaskNode;
import com.eascs.workflow.common.vo.CancleProcessParam;
import com.eascs.workflow.common.vo.CloseProcessParam;
import com.eascs.workflow.common.vo.ModelResult;
import com.eascs.workflow.common.vo.ProcessTimeParam;
import com.eascs.workflow.common.vo.ProcessTimeVo;
import com.eascs.workflow.common.vo.UserTaskParam;
import com.eascs.workflow.common.vo.UserTaskVo;
import com.eascs.workflow.common.vo.WFRequestParam;

/**
 * 工作流接口
 * 
 * @author user
 *
 */
public interface WorkFlowService {
	/**
	 * 流程启动接口
	 * 
	 * @param WFRequestParam
	 * @return
	 */
	public ModelResult<Boolean> instance(WFRequestParam requestParam);

	/**
	 * 流程启动接口，并返回结果
	 * 
	 * @param WFRequestParam
	 * @return
	 */
	public ModelResult<ProcessTaskMain> instanceWithResult(WFRequestParam requestParam);

	/**
	 * 查询经办、待办、已办流程列表
	 * 
	 * @param userTaskParam
	 * @return
	 */
	public ModelResult<PageResult<UserTaskVo>> queryUserTaskByPage(UserTaskParam userTaskParam);

	public ModelResult<ProcessTaskMain> queryTaskMainById(String taskId);

	/**
	 * 关闭贷款单下所有流程
	 * 
	 * @param closeProcessParam
	 * @return
	 */
	public ModelResult<Boolean> closeProcess(CloseProcessParam closeProcessParam);

	/**
	 * 查询经办业务参数
	 * 
	 * @param nodeAuditorId
	 * @return
	 */
	public ModelResult<String> queryReferIdByNodeAuditorId(String nodeAuditorId);

	/**
	 * 查询贷款单的各流程审批时间
	 * 
	 * @return
	 */
	public ModelResult<PageResult<ProcessTimeVo>> queryProcessTimes(ProcessTimeParam param);

	/**
	 * 待办提醒
	 * 
	 * @return
	 */
	public ModelResult<Boolean> wfWorkWarnEmail();

	/**
	 * 返回省区平台
	 * 
	 * @return
	 */
	public ModelResult<String> getProvincebyUNITNO(String unitno);

	/**
	 * 查询流程状态
	 * 
	 * @param taskIds
	 * @return
	 */
	public ModelResult<List<Object[]>> getProcessTaskStatus(List<String> taskIds);

	/**
	 * 作废流程
	 * 
	 * @param param
	 * @return
	 */
	public ModelResult<Boolean> cancelProcess(CancleProcessParam param);

	/**
	 * 根据流程大类，查询流程类型
	 * 
	 * @param catagory
	 * @return
	 */
	public ModelResult<List<DicData>> getProcessTypeByCatagory(String catagory);

	/**
	 * 根据referId，processType 获取流程审核意见
	 * @param referId
	 * @param processType
	 * @return
	 */
	public ModelResult<ProcessTaskMain> getAgreeInfo(String referId, String processType);
	
	/**
	 * 查询审批意见慨况列表
	 * @param referId
	 * @return
	 */
	public ModelResult<List<ProcessTaskMain>> queryAgreeList(String referId);
	
	public ProcessTaskNode getTaskNodeDetail(String referId,String processType,String nodeCode);
}
